<!-- 堆叠层数 -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>堆叠层数</title>
    <style>
        div {
            position: absolute;
            width: 200px;
            height: 200px;
        }

        .box1 {
            background-color: rgb(183, 38, 38);
            /* 取值是整数，默认值是0，取值越大显示顺序越靠上 */
            z-index: 0;
        }

        .box2 {
            background-color: brown;
            left: 100px;
            top: 100px;
            z-index: 1;
        }

    </style>
</head>
<body>
    <div class="box1">box1</div>
    <div class="box2">boc2</div>
</body>
</html>